﻿@using MrCMS.Helpers
@model MrCMS.Batching.Entities.Batch

<fieldset data-batch-id="@Model.Id" data-refresh-url="@Url.Action("ShowPartial", "Batch", new { Model.Id })">
    <legend>
        Batch #@Model.Id
        <span class="btn-group display-inline pull-right">
            @Html.ActionLink("Back to list", "Index", "Batch", new { }, new { @class = "btn btn-default" })
        </span>
    </legend>
    <div class="row">
        <div class="col-xs-12">
            <h3>
                Runs
            </h3>

            <table class="table table-striped table-condensed">
                <thead>
                    <tr>
                        <th>
                            Created On
                        </th>
                        <th>
                            Status
                        </th>
                        <th>
                            Completion
                        </th>
                        <th>
                            Execution Time
                        </th>
                        <th>
                            Actions
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var run in Model.BatchRuns.OrderByDescending(run => run.Id))
                    {
                        Html.RenderAction("Row", "BatchRun", new { run.Id });
                    }
                </tbody>
            </table>
        </div>
    </div>
    @*<div class="row">
        <div class="col-xs-12">
            <h3>
                Jobs
            </h3>
            <table class="table table-striped table-condensed">
                <thead>
                    <tr>
                        <th>
                            Type
                        </th>
                        <th>
                            Status
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var job in Model.BatchJobs)
                    {
                        Html.RenderAction("Row", "BatchJob", new { job.Id });
                    }
                </tbody>
            </table>
        </div>
    </div>*@
</fieldset>